﻿#region Usings
using System;
using System.Web.UI;
using Lib.ApplicationBlocks.DbBlocks.Membership;
using Lib.ApplicationBlocks.Modules.Web.General.Pages;
#endregion

namespace BK.WebSite
{
	public partial class General : MasterPage
	{
		#region Instance Methods
		protected void Page_Load(object sender, EventArgs e)
		{
			if (!IsPostBack)
			{
				CultureAndLocal cultureAndLocal = ((BasePage) Page).GetCultureAndLocal();

				if (cultureAndLocal != null)
					ddlLanguages.SelectedValue = cultureAndLocal.CultureName;
			}
		}

		protected void ddlLanguages_SelectedIndexChanged(object sender, EventArgs e)
		{
			((BasePage) Page).SetCulture(new CultureAndLocal
			                             	{
			                             		CultureName = ddlLanguages.SelectedValue,
			                             		LocaleName = ddlLanguages.SelectedValue
			                             	});
		}
		#endregion
	}
}